﻿@page "/event"

@*
    事件和事件参数
*@


<button style="@style" @onclick="Click" @onmouseenter="MouseOver" @onmouseleave="MouseOut">按钮</button>

@if (buttonClicked)
{
    <h3>按钮已经被点击</h3>
}

@code{
    bool buttonClicked;
    string style;
    void Click(MouseEventArgs e)
    {
        buttonClicked = true;
    }

    void MouseOver()
    {
        style = "font-size:10px";
    }
    void MouseOut()
    {
        style = string.Empty;
    }
}